﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WxSDK.BLL
{
    public class Wx_Member : Base<WxSDK.Model.wx_member>
    {
         public object chkAdminLogin(string UserName, string UserPwd, string code)
         {
             if (string.IsNullOrEmpty(UserName))
                 return new { res = false, msg = "请填写用户名", input = "username" };

             if (string.IsNullOrEmpty(UserPwd))
                 return new { res = false, msg = "请填写密码", input = "pwd" };


             if (!Exists(string.Format("UserName='{0}' and UserPwd='{1}'", UserName, UserPwd)))
             {
                 return new { res = false, msg = "用户名不存在", input = "username" };
             }
             else
             {
                 int MemberId = GetModel(string.Format(" where UserName='{0}' and UserPwd='{1}'", UserName, UserPwd)).Id;
                 WeChatCommon.WriteSession("MemberId", MemberId.ToString());
                 return new { res = true };
             }

         }



    }
}
